<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>秘密花园</title>
<link rel="stylesheet" href="/networkforum/css/user_info.css" />
<link rel="stylesheet" href="/networkforum/css/user_control_garden.css" />

<script type="text/javascript">
window.onload = function(){
	//gardenInfo(0,10,"默认");

	//好友分页
	var myajax = getByAjax();
	myajax.init(null,"get",true);
	myajax.get("/networkforum/control/get_wall.do?index=0&size=8",function(d){
		var data = toJson(d);
		page.view("articleInner",data,option);
		/**/
	});
	myajax = null;

	var myajax = getByAjax();
	myajax.init(null,"get",true);
	myajax.get("/networkforum/wall/count_wall.do?index=0&size=8",function(d){
		paging.page({
			size:8,
			total:Math.ceil(d/8),
			url:"/networkforum/control/get_wall.do",
			previou:document.getElementById("previouPage"),
			next:document.getElementById("nextPage"),
			current:document.getElementById("currentPage"),
			max:document.getElementById("totalPage"),
			callBack:function(d){
				page.view("articleInner",d,option);
			},
		});
	});
	myajax = null;
}

var option = {
	wallName:{
		param:{id:"wallName"},
		bind:{wallId:"wallId"}
	},
	pictureSrc:{
		'param':{'id':"wallSrc"}
	},
	'publishTime':{
		'param':{'id':"time"}
	},
	'wallContents':{
		'param':{'id':"wallContent"}
	}
}
function deleteInfo(event){
	event = event||window.event;
	var target = event.target;

	var li = target.parentElement;
	var wallId = li.children[0].wallId;

	var myajax = getByAjax();
	myajax.init(null,"get",true);
	myajax.get("/networkforum/wall/delete_wall.do?wallId="+wallId,null);
	myajax = null;

	li.parentElement.removeChild(li);
}
</script>
</head>

<body>	
	<h2 class="header">笑脸墙</h2>
	<!-- <div class="grdenNav">
		<span onclick="gardenOption(event,'option')">最新</span>
		<span onclick="gardenOption(event,'option')">最早</span>
	</div>
	<div id="choice" class="choice">
		<span>默认</span>
	</div> -->
		<!-- <label id="save">保存</label> -->
	<ul class="grdenInner" id="articleInner">
		<li>
			<span id="wallName">名称</span>
			<img id="wallSrc" src=""/>
			<span id="wallContent">备注</span>
			<span id="time">时间</span>
			<span id="delete" onclick="deleteInfo(event);">删除</span>
		</li>
		<li id="giHeader">
			<span id="wallName">名称</span>
			<span id="wallSrc">笑脸</span>
			<span id="wallContent">备注</span>
			<span id="time">时间</span>
			<span id="delete"></span>
		</li>
	</ul>
	<div class="paging" id="paging">
   		<div class="clear"></div>
   		<span id="previouPage" style="cursor: pointer;">上一页</span>
   		<!--  <span id="currentPage2">1</span>-->
   		<input id="currentPage" type="text" value = "1"/>	
   		<span id="nextPage" style="cursor: pointer;">下一页</span>
   		<span id="totalPage">共 1 页</span>
   	</div>
</body>
<script src="/networkforum/js/view.js" type="text/javascript"></script>
<script src="/networkforum/js/combo.js" type="text/javascript"></script>
<script src="/networkforum/js/myajax.js" type="text/javascript"></script>
<script src="/networkforum/js/pageing.js" type="text/javascript"></script>
</html>
